
indir=$1

echo
echo indir:$indir
echo

files=$(find $indir | grep "/TRDCalibObj")

echo files: $files
echo 

for ii in $files
do 
#    echo $ii
    run=$(echo $ii | awk -F\/ '{print $2}')
    echo $run "$(pwd)/$ii to ~/.data/TRDdEdx_Calib/inuse/TRDCalibObj_0000$run.root"
    ln -s $(pwd)/$ii ~/.data/TRDdEdx_Calib/inuse/Calib_TRDdEdx_0000$run.root

done

